package com.sbj.dto.utils;

import cn.hutool.core.util.RandomUtil;
import cn.zhxu.bs.SearchResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sbj.dto.res.BuyRes;
import org.apache.poi.ss.formula.functions.T;

/**
 * @author summer
 * @version 1.0
 * @date 2024/8/10 14:54
 */
public class Search {

    public static <T> Page<T> searchDataList(Integer pageNum,Integer pageSize, SearchResult<T> searchResult) {
        Page<T> page=new Page<>(pageNum,pageSize);
        page.setRecords(searchResult.getDataList());
        page.setTotal(searchResult.getTotalCount().longValue());
        return page;
    }

    public static void main(String[] args) {
        System.out.println(RandomUtil.randomString(6));
    }
}
